package com.zz.inventory.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.zz.inventory.domain.ExperimentScenariosWithPurchase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zz.inventory.mapper.ExperimentScenariosMapper;
import com.zz.inventory.domain.ExperimentScenarios;
import com.zz.inventory.service.IExperimentScenariosService;

/**
 * 实验场景信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-01
 */
@Service
public class ExperimentScenariosServiceImpl implements IExperimentScenariosService 
{
    @Autowired
    private ExperimentScenariosMapper experimentScenariosMapper;

    /**
     * 查询实验场景信息
     * 
     * @param scenarioId 实验场景信息主键
     * @return 实验场景信息
     */
    @Override
    public ExperimentScenarios selectExperimentScenariosByScenarioId(Long scenarioId)
    {
        return experimentScenariosMapper.selectExperimentScenariosByScenarioId(scenarioId);
    }

    /**
     * 查询实验场景信息列表
     * 
     * @param experimentScenarios 实验场景信息
     * @return 实验场景信息
     */
    @Override
    public List<ExperimentScenarios> selectExperimentScenariosList(ExperimentScenarios experimentScenarios)
    {
        return experimentScenariosMapper.selectExperimentScenariosList(experimentScenarios);
    }

    /**
     * 新增实验场景信息
     * 
     * @param experimentScenarios 实验场景信息
     * @return 结果
     */
    @Override
    public int insertExperimentScenarios(ExperimentScenarios experimentScenarios)
    {
        experimentScenarios.setCreateTime(DateUtils.getNowDate());
        return experimentScenariosMapper.insertExperimentScenarios(experimentScenarios);
    }

    /**
     * 修改实验场景信息
     * 
     * @param experimentScenarios 实验场景信息
     * @return 结果
     */
    @Override
    public int updateExperimentScenarios(ExperimentScenarios experimentScenarios)
    {
        return experimentScenariosMapper.updateExperimentScenarios(experimentScenarios);
    }

    /**
     * 批量删除实验场景信息
     * 
     * @param scenarioIds 需要删除的实验场景信息主键
     * @return 结果
     */
    @Override
    public int deleteExperimentScenariosByScenarioIds(Long[] scenarioIds)
    {
        return experimentScenariosMapper.deleteExperimentScenariosByScenarioIds(scenarioIds);
    }

    /**
     * 删除实验场景信息信息
     * 
     * @param scenarioId 实验场景信息主键
     * @return 结果
     */
    @Override
    public int deleteExperimentScenariosByScenarioId(Long scenarioId)
    {
        return experimentScenariosMapper.deleteExperimentScenariosByScenarioId(scenarioId);
    }

    @Override
    public List<ExperimentScenariosWithPurchase> selectValidPurchasedScenariosBySchoolId(Long schoolsId) {
        return experimentScenariosMapper.selectValidPurchasedScenariosBySchoolId(schoolsId);
    }
}
